package com.QSMoney.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;


import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

//让子类的equals/hashCode方法包含父类字段（否则默认只比较子类自身字段）
@EqualsAndHashCode(callSuper = true)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("moneyuser")
/**
 * 用户实体类
 */
public class MoneyUser extends BaseEntity implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;
    @TableId(type = IdType.AUTO)
    @Schema(description = "用户id")
    private Long User_id;
    @Schema(description = "用户名")
    private String userName;
    @Schema(description = "昵称")
    private String nickName;
    @Schema(description = "密码")
    private String passWord;
    @Schema(description = "手机号")
    private String phoneNumber;
    @Schema(description = "邮箱")
    private String email;
    @Schema(description = "头像")
    private String avatar;
    @Schema(description = "用户状态（0正常 1停用）")
    private String status;
    @Schema(description = "最后登录时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date loginDate;
}
